from flask import Flask,request,json,jsonify,render_template
from api import config
from . import hello_fuc

def hello():
    # 获取前端传递的json数据
    if request.method == 'GET':
        data = hello_fuc.hello()
        print("get请求:",data)
        return jsonify({"code":200,"msg":"success","data":data})
    elif request.method == 'POST':
        data = request.get_data()
        data = json.loads(data)
        print("POST请求:",data)
        return hello_fuc.hello()